﻿<UserControl x:Class="Mnk.TBox.Plugins.SqlRunner.Settings"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.SqlRunner.Code.Localization"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WPFControls"
             xmlns:Settings="clr-namespace:Mnk.TBox.Plugins.SqlRunner.Code.Settings"
             mc:Ignorable="d" d:DesignHeight="360" d:DesignWidth="600" 
             >
    <TabControl>
        <TabItem Header="{loc:Tr SqlScripts}">
            <DockPanel>
                <GroupBox Header="{loc:Tr Profile}" DockPanel.Dock="Top">
                    <Units:ComboBoxUnit Name="Profile" ValueCaption="{Binding SelectedProfile}" ItemsSource="{Binding Profiles}" UnitType="Text" Title="{loc:Tr ConfigureProfile}"/>
                </GroupBox>
                <Units:ListBoxUnit IsEnabled="{Binding ElementName=Profile,Path=IsSelected}" DataContext="{Binding ElementName=Profile, Path=SelectedValue}" ItemsSource="{Binding Ops}" UnitType="Text" Title="{loc:Tr ConfigureOperation}">
                    <Units:ListBoxUnit.ItemTemplate>
                        <DataTemplate DataType="{x:Type Settings:Op}">
                            <DockPanel>
                                <Button Content="..." VerticalAlignment="Center" Width="32" Margin="1" Click="BtnRequestClick" DockPanel.Dock="Right" Tag="{Binding Key}"/>
                                <TextBlock Text="{Binding Key}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
                            </DockPanel>
                        </DataTemplate>
                    </Units:ListBoxUnit.ItemTemplate>
                </Units:ListBoxUnit>
            </DockPanel>
        </TabItem>
        <TabItem Header="{loc:Tr ConfigureConnectionToDatabase}">
            <StackPanel>
                <GroupBox Header="{loc:Tr ConnectionStringToUseByDefault}" DockPanel.Dock="Bottom" >
                    <Units:ComboBoxUnit ValueCaption="{Binding ConnectionString}" ItemsSource="{Binding ConnectionStrings}" UnitType="Text" Title="{loc:Tr ConfigureConnectionString}"/>
                </GroupBox>
            </StackPanel>
        </TabItem>
    </TabControl>
</UserControl>
